﻿using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace CPPProject.CPP
{
    /// <summary>
    /// 订单表
    /// </summary>
    [Table("CPPOrderHed")]
    public class CPPOrderHed : Entity<Guid>, IHasCreationTime, IMustHaveTenant, IModificationAudited, ICreationAudited
    {
        public int TenantId { get; set; }
        public DateTime CreationTime { get; set; }
        public long? CreatorUserId { get; set; }
        public long? LastModifierUserId { get; set; }
        public DateTime? LastModificationTime { get; set; }
        /// <summary>
        /// 所属公司
        /// </summary>
        public long CompanyId { get; set; }
        [ForeignKey("CompanyId")]
        public virtual CPPCompany TCompany { get; set; }
        /// <summary>
        /// 订单编号
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string OrderNum { get; set; }
        /// <summary>
        /// 合同编号
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string ContractNum { get; set; }
        /// <summary>
        /// 客户编码
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string CustNum { get; set; }
        /// <summary>
        /// 下单日期
        /// </summary>
        [Required]
        public DateTime OrderDate { get; set; }
        /// <summary>
        /// 订单交期
        /// </summary>
        [Required]
        public DateTime DueDate { get; set; }
        /// <summary>
        /// 订单状态（0待审核1确认审核2确认完成3已关闭4审核中）
        /// </summary>
        [MaxLength(10)]
        public string Status { get; set; }
        /// <summary>
        /// 发出站点
        /// </summary>
        [MaxLength(50)]
        public string FromPlantId { get; set; }
        /// <summary>
        /// 接收站点
        /// </summary>
        [MaxLength(50)]
        public string ToPlantId { get; set; }
        /// <summary>
        /// 类型（1发出2回收）
        /// </summary>
        [MaxLength(10)]
        public string IType { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        [MaxLength(300)]
        public string Remark { get; set; }
        /// <summary>
        /// 申请理由
        /// </summary>
        [MaxLength(300)]
        public string ApplyReason { get; set; }
        /// <summary>
        /// 其他要求
        /// </summary>
        [MaxLength(300)]
        public string OtherRequire { get; set; }
        /// <summary>
        /// 项目路线
        /// </summary>
        [MaxLength(50)]
        public string ProjectName { get; set; }
        /// <summary>
        /// 收货地址
        /// </summary>
        [MaxLength(300)]
        public string Address { get; set; }
        /// <summary>
        /// 联系人
        /// </summary>
        [MaxLength(50)]
        public string Contactor { get; set; }
        /// <summary>
        /// 联系电话
        /// </summary>
        [MaxLength(50)]
        public string Telphone { get; set; }
        /// <summary>
        /// 运输方式
        /// </summary>
        [MaxLength(50)]
        public string TransMode { get; set; }
        /// <summary>
        /// 车牌号
        /// </summary>
        [MaxLength(50)]
        public string CarId { get; set; }
        /// <summary>
        /// 司机联系电话
        /// </summary>
        [MaxLength(50)]
        public string DriverPhone { get; set; }
        /// <summary>
        /// 业务类型（0期租1次租2贸易）
        /// </summary>
        [MaxLength(10)]
        public string BusType { get; set; }
        /// <summary>
        /// 租赁天数
        /// </summary>
        public int NDays { get; set; }
        /// <summary>
        /// 审核人
        /// </summary>
        [MaxLength(50)]
        public string ApproveUser { get; set; }
    }
}
